<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="t" tagdir="/WEB-INF/tags"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ page import="com.guo.hui.model.shiro.TpUser"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<t:link />
<title>后台管理</title>

<style type="text/css">

/*去除ui li前面圆点  list-style: none*/
/* solid 实线边框 1px 边框宽度 边框颜色 
border-style:solid;
border-width:1px;
border-color:red;
margin: top right bottom left
*/
* {
	margin: 0;
	padding: 0
}

body {
	font-size: 12px;
	font-family: "宋体", "微软雅黑";
}

ul, li {
	list-style: none;
}

a:link, a:visited {
	text-decoration: none;
	color: #fff;
}

.list {
	width: 100%;
	border-bottom: solid 1px #316a91;
	margin: 5px auto 0 5px;
}

.list ul li {
	background-color: #467ca2;
	border: solid 1px #316a91;
	border-bottom: 0;
}

.list ul li a {
	padding-left: 10px;
	color: #fff;
	font-size: 12px;
	display: block;
	font-weight: bold;
	height: 36px;
	line-height: 36px;
	position: relative;
}

.list ul li .inactive {
	background: url(../static/image/1.png) no-repeat 184px center;
}

.list ul li .inactives {
	background: url(../static/image/2.png) no-repeat 184px center;
}

.list ul li ul {
	display: none;
}

.list ul li ul li {
	border-left: 0;
	border-right: 0;
	background-color: #6196bb;
	border-color: #467ca2;
}

.list ul li ul li ul {
	display: none;
}

.list ul li ul li a {
	padding-left: 20px;
}

.list ul li ul li ul li {
	background-color: #d6e6f1;
	border-color: #6196bb;
}

.last {
	background-color: #d6e6f1;
	border-color: #6196bb;
}

.list ul li ul li ul li a {
	color: #316a91;
	padding-left: 30px;
}
</style>




</head>
<body class="easyui-layout">
	<div
		data-options="region:'north',title:'header',split:true,noheader:true"
		style="height: 10%; background: #666; overflow-y: hidden;">
		<div class="logo">
			<shiro:principal property="usercode" />
		</div>
		<%-- <div id="userid">
			<shiro:principal property="id" />
		</div> --%>
		<%-- <%
			TpUser user = (TpUser) request.getSession().getAttribute("user");
		%> --%>
		<%-- <div id="userid">
			<%
				out.println(user.getId());
			%>
		</div> --%>
		<%-- <input id="userid" type="hidden" value="<%=user.getId()%>"> --%>
		<div class="logout" style="text-align: right;">
			您好!|<a href="${pageContext.request.contextPath}/shang/logout">退出</a>
		</div>

	</div>
	<div
		data-options="region:'west',split:true,iconCls:'icon-world',title:'导航'"
		style="width: 200px; padding: 10px;">
		<div class="list">
			<ul class="yiji">
				<li onclick="save('userperson')"><a href="#">个人信息</a></li>
				<li><a href="#" class="inactive active">权限管理</a>
					<ul>
						<shiro:hasPermission name="/blogadmin/user">
							<li onclick="save('user')"><a href="#">用户管理</a></li>
						</shiro:hasPermission>
						<li onclick="save('role')"><a href="#">角色管理</a></li>
						<li onclick="save('permission')"><a href="#">权限管理</a></li>
					</ul></li>
				<li><a href="#" class="inactive active">文章管理</a>
					<ul>
						<li onclick="save('article')"><a href="#">文章列表</a></li>
						<shiro:hasPermission name="/myline/index">
							<li onclick="save('myline')"><a href="#">时光轴</a></li>
						</shiro:hasPermission>
					</ul></li>
				<li><a href="#" class="inactive active">字典管理</a>
					<ul>
						<li onclick="save('dict')"><a href="#">字典管理</a></li>
						<li onclick="save('tool')"><a href="#">工具管理</a></li>
					</ul></li>
				<li><a href="#" class="inactive">评论管理</a>
					<ul style="display: none">
						<li><a href="#" class="inactive active">链接管理</a>
							<ul>
								<li><a href="#">内网</a></li>
								<li><a href="#">外网</a></li>
							</ul></li>
						<!-- <li><a href="#" class="inactive active">中国文联美术艺术中心</a>
							<ul>
								<li><a href="#">综合部</a></li>
								<li><a href="#">大型活动部</a></li>
							</ul></li>
						<li class="last"><a href="#">《美术》杂志社</a></li> -->
					</ul></li>
			</ul>
		</div>
	</div>

	<div id="main"
		data-options="region:'center',split:true,iconCls:'icon-world'">
	</div>

</body>

<script type="text/javascript">
	$(document)
			.ready(
					function() {
						$('.inactive')
								.click(
										function() {
											var className = $(this).parents(
													'li').parents().attr(
													'class');
											if ($(this).siblings('ul').css(
													'display') == 'none') {
												if (className == "yiji") {
													$(this)
															.parents('li')
															.siblings('li')
															.children('ul')
															.parent('li')
															.children('a')
															.removeClass(
																	'inactives');
													$(this).parents('li')
															.siblings('li')
															.children('ul')
															.slideUp(100);
													$(this)
															.parents('li')
															.children('ul')
															.children('li')
															.children('ul')
															.parent('li')
															.children('a')
															.removeClass(
																	'inactives');
													$(this).parents('li')
															.children('ul')
															.children('li')
															.children('ul')
															.slideUp(100);
												}
												$(this).addClass('inactives');
												$(this).siblings('ul')
														.slideDown(100);
											} else {
												$(this)
														.removeClass(
																'inactives');
												$(this).siblings('ul').slideUp(
														100);
											}
										})
					});
</script>

<script>
	function save(type) {
		
		var content;
		if ("article" == type) {
			content = '<iframe src="${pageContext.request.contextPath}/blogarticle/article" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}
		if ("user" == type) {
			content = '<iframe src="${pageContext.request.contextPath}/blogadmin/user" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}
		if ("userperson" == type) {
			var id = $("#userid").val();
			var url ='${pageContext.request.contextPath}/blogadmin/userperson?id='+id;
			content = '<iframe src="'+url+'+" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}
		if ("myline" == type) {
			content = '<iframe src="${pageContext.request.contextPath}/myline/index" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}
		if ("role" == type) {
			content = '<iframe src="${pageContext.request.contextPath}/blogarticle/articleadd" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}
		if ("permission" == type) {
			content = '<iframe src="${pageContext.request.contextPath}/myline/index" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}
		if ("dict" == type) {
			content = '<iframe src="${pageContext.request.contextPath}/dict/index" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}
		if ("tool" == type) {
			content = '<iframe src="${pageContext.request.contextPath}/tool/index" scrolling="auto" frameborder="0" style="width: 100%; height: 100%;"></iframe>';
		}

		$("#main").html(content);

	}
</script>

</html>